Skip to content

fix(eval): reclaim suppression entries of fired deadman correlations - #863

Merged
mostafa merged 8 commits into
mainfrom
fix/plan24-r5
Dec 2, 2026
Merged

mostafa merged 8 commits into
mainfrom
fix/plan24-r5

Conversation

@mostafa

@mostafa mostafa commented Dec 1, 2026

Copy link
Copy Markdown
Member

A fired deadman group is dropped from the correlation state, so it no longer counts toward max_state_entries. The only pass that cleared expired suppression entries ran when that cap was hit, so with absence correlations the cap was rarely reached and every fired deadman group left its last alert in memory for good. A deadman rule over many distinct groups grew last_alert without bound.

  • When a fired deadman group is dropped and no suppress applies (neither the correlation's rsigma.suppress nor the engine default), its last alert is dropped with it, since nothing reads it.
  • Otherwise the path that fires due deadlines also reclaims expired suppression entries, at most once per second of the newest tenant clock, independent of the state cap. The cap eviction still runs the same reclaim.
  • Both reclaim passes measure each entry against its own tenant's event-time clock, falling back to the newest accepted event time for a tenant without one. A single cross-tenant reference would end a lagging tenant's suppression early when a tenant running ahead ticks, and would treat an alert that an idle tick fired ahead of other tenants' events as already expired. The cap eviction had the second problem before this change; it now uses the same per-tenant reference. The check for whether a window is still active is unchanged.

Tests cover 10,000 fired deadman groups with and without suppress (the entries drop to zero once the window passes), and suppression across two tenants whose clocks are far apart, including the idle-tick alert case through the state cap.

A deadman group is dropped once it fires, so it no longer counts toward `max_state_entries`, and the only pass that cleared expired suppression entries ran when that cap was hit. Every fired deadman group therefore left its last alert in memory for good.

Dropping a fired group now also drops its last alert when no suppress applies. Otherwise the deadline path reclaims expired entries at most once per second of the newest tenant clock. Both that pass and the cap eviction measure each entry against its own tenant's clock, falling back to the newest event time for a tenant without one, so a tenant running ahead cannot end another tenant's suppression early or expire an alert that an idle tick fired ahead of other tenants' events.
@mostafa mostafa added the performance Run the coarse performance regression gate on this PR label Dec 1, 2026
Base automatically changed from fix/plan24-r4 to main December 1, 2026 23:07
A command enricher's argv is the operator's, and event values reach the
command only through env. A config that puts a ${detection.*} or
${correlation.*} reference anywhere in command, uses a non-literal env
key, gives a variable that loads code an event value, or has a cmd argv
expand such a variable as %NAME% fails at load. The per-program argv
reading, the leading-dash check, and the fuzz targets that exercised
them are removed.
fuzz_command_strict builds command enricher configs from argv entries and env keys and values drawn from literals, environment and event references, and cmd %NAME% forms, and checks that a config loads exactly when the argv has no event reference, every env key is literal, no loader variable takes an event value, and a cmd argv does not expand one as %NAME%.
Refuse event values in command enricher argv
@mostafa
mostafa merged commit 448ea22 into main Dec 2, 2026
31 checks passed
@mostafa
mostafa deleted the fix/plan24-r5 branch December 2, 2026 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Run the coarse performance regression gate on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant